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

Query time 0.00076