UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9I/ZWQ0KgKtWza3TjlT8qZKnbK0IwfIbxtV58LWsBPM=' 
WHERE 
  key_id = 'f88efade192389bff97a6e62c0454109c11beba957a5adde2676e178a4a83ec0' 
  AND (
    token = '9I/ZWQ0KgKtWza3TjlT8qZKnbK0IwfIbxtV58LWsBPM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039