UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lDWYuT7ENJNzv3H5vSVbUgHFc8EdCg6uCaTfFC1aUrA=' 
WHERE 
  key_id = '7189dfb873411467f6fe9859da6e3fd6c3f93c5ee328201d5011605fd73f33f7' 
  AND (
    token = 'lDWYuT7ENJNzv3H5vSVbUgHFc8EdCg6uCaTfFC1aUrA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023