UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/ZCPWqRdxUj0qvsdEeakPoXb+qtAnTh+f1EepOwgMWA=' 
WHERE 
  key_id = 'dd5673b0bc215c8e24f23b1c88034aad41ff0fd444cb17516fe511b5373ce818' 
  AND (
    token = '/ZCPWqRdxUj0qvsdEeakPoXb+qtAnTh+f1EepOwgMWA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032