UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gGepyakYK6MySX8BkHTIzJM5UAhlElFOqoWoApgMMgo=' 
WHERE 
  key_id = '0e5efec290a02bf8d8de1945c59f39ab82c5fd61af1ec74a8d64d9168aec4bd7' 
  AND (
    token = 'gGepyakYK6MySX8BkHTIzJM5UAhlElFOqoWoApgMMgo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028