UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z7OcxPqzBIKn8xxbvf4+b6mXU+HUNAfUeWCgSUrQo6c=' 
WHERE 
  key_id = '23826202a3b1d870337674008a819d8d21cc8b37d50e76209585319fed5feae0' 
  AND (
    token = 'z7OcxPqzBIKn8xxbvf4+b6mXU+HUNAfUeWCgSUrQo6c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026