UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bJzH6TLfD88meXzgzVAnAgPiPVxeWZnp2AVR6OcSrn4=' 
WHERE 
  key_id = 'a603649b9933802cbdea2477105961abf6f035a8cbfba6891227eefc17549fff' 
  AND (
    token = 'bJzH6TLfD88meXzgzVAnAgPiPVxeWZnp2AVR6OcSrn4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030