UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qQ1CpmopE9lYgkaTV+IkKFAFDZVNRtKunOxnXPASaBo=' 
WHERE 
  key_id = '261a9de82229f04ee47bb7ebed8e93cf99f05c7d3f0fd49aadbf60a82c8b5787' 
  AND (
    token = 'qQ1CpmopE9lYgkaTV+IkKFAFDZVNRtKunOxnXPASaBo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019