UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LVxrgSLgzT2zr4CdlKf7sb2fmkCI7Dli04dnsclZ2YQ=' 
WHERE 
  key_id = '1dfd6ec4c75223d3b35084833a8ecd63379c95dbddf3b2766441f00d85df68d8' 
  AND (
    token = 'LVxrgSLgzT2zr4CdlKf7sb2fmkCI7Dli04dnsclZ2YQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027