UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'd9l+AfrqbAm+sugAyFex8nYmFgOP4NzM8tLrsj6fHbo=' 
WHERE 
  key_id = '2ed1e6e3595b177659e027f0f9b33accdbae8a0130ebd2d65882cb6c32b5ddea' 
  AND (
    token = 'd9l+AfrqbAm+sugAyFex8nYmFgOP4NzM8tLrsj6fHbo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020