UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xpGaO48L+wMixbHz4yoiOcMt4svkwQog1rDzC0taPwM=' 
WHERE 
  key_id = '67d20e54c704c53bfaae4da23be8c4b0ea9714e4998db9857fd76bb257dc3d3e' 
  AND (
    token = 'xpGaO48L+wMixbHz4yoiOcMt4svkwQog1rDzC0taPwM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030