UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'R93rWntas4ex41T9tiLMI2pr5F34E4EUUNMJvBpZDfU=' 
WHERE 
  key_id = '0a346b159e6039a60907db2e572c5baa43110ab249bb04502ef8034f12c5bef7' 
  AND (
    token = 'R93rWntas4ex41T9tiLMI2pr5F34E4EUUNMJvBpZDfU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019