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

Query time 0.00030