UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ObhyYi1nCJmRp/Ok/lr+Szg3ZD7YJ/lbU0MALgot6Cs=' 
WHERE 
  key_id = '284b3bb2df9f85724f6dfd454e80b70f974b7b5afa9536853bf7f1d16fb8418c' 
  AND (
    token = 'ObhyYi1nCJmRp/Ok/lr+Szg3ZD7YJ/lbU0MALgot6Cs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018