UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0R2+ekb8KgFlIEke3i0lArx/dZV6JMpCIpQJUg2MXfc=' 
WHERE 
  key_id = 'e7b3fbd3b8a86dd996254f7e985fbe2aa13b2b5a0e5c2a55194925b3b0e1165a' 
  AND (
    token = '0R2+ekb8KgFlIEke3i0lArx/dZV6JMpCIpQJUg2MXfc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061