UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8uBej6Ij6hcTzUdN3F7ynpjBEJ/InR/6Pbsj/ehMHGY=' 
WHERE 
  key_id = '57b6db243640e849c1a1fbab3cc40b83e8d8d34b811000a11c7ae163b623151e' 
  AND (
    token = '8uBej6Ij6hcTzUdN3F7ynpjBEJ/InR/6Pbsj/ehMHGY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026