UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5Axtelm/ODcsF/Mt7g0ZDuHnFlVDeFGibmoQ+RmkX9U=' 
WHERE 
  key_id = '23a20d3e466005011af19015d2e02b6ec3e6bcf1d22452628c3d61ac791bb2f7' 
  AND (
    token = '5Axtelm/ODcsF/Mt7g0ZDuHnFlVDeFGibmoQ+RmkX9U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018