UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NHYEhseORn0fC3pMc5bDDuzkOleA8PPzf5GdN+RoCDo=' 
WHERE 
  key_id = 'daf11670fb3c4cd1487dbd6dce2541dbcc08ec71d1f0130f2ade566389c8a1bc' 
  AND (
    token = 'NHYEhseORn0fC3pMc5bDDuzkOleA8PPzf5GdN+RoCDo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051