UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vteeFOL/vq5+AsvuzM9XVyO3C99L+Ct+u31ZH0myk3g=' 
WHERE 
  key_id = '90d642985cb23720e3431cd83d5c24f73667d750e8c3310501775e5f80d20441' 
  AND (
    token = 'vteeFOL/vq5+AsvuzM9XVyO3C99L+Ct+u31ZH0myk3g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055