UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b+fQvin7UQoYxTPeXbuwW7iolPVKUTTfqN/2nDzlANQ=' 
WHERE 
  key_id = 'fbf306e62ff0117b4a4cb6e2dda7d99247cf2ade14f773ba17c330a05618a95a' 
  AND (
    token = 'b+fQvin7UQoYxTPeXbuwW7iolPVKUTTfqN/2nDzlANQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042