UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WGH1dT8sEzpU7B/Ai8ulmpZkeZL4gkEb8xghHmKqbyI=' 
WHERE 
  key_id = '2133d6fdd050c167dc1c506ba393a12e6d7ab7631999c9d0d7603c9e463060e6' 
  AND (
    token = 'WGH1dT8sEzpU7B/Ai8ulmpZkeZL4gkEb8xghHmKqbyI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044