UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jF/O2Vx0o68TaYxrHppCEpDRkEmsrIhbv0eJHrslE1c=' 
WHERE 
  key_id = '5fc1197d4526072cc342f477461dccf6a49c4425b81286252894718b1eb649a3' 
  AND (
    token = 'jF/O2Vx0o68TaYxrHppCEpDRkEmsrIhbv0eJHrslE1c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037