UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EE8nscG0D+K5pPBdD1rIXev+Ih+Us4wJLbodrTlDNWE=' 
WHERE 
  key_id = '1949ae6be248d3ad8aae1b9a17eba7684af14c2fda84ceee35a72644645568e0' 
  AND (
    token = 'EE8nscG0D+K5pPBdD1rIXev+Ih+Us4wJLbodrTlDNWE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034