UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Qqea4SAc/883KI8MrXYYOGM4rBq4W0Rk1cXhoTr0jFY=' 
WHERE 
  key_id = '1e67c6ca13833891a89e6044f0d87c4af499d0e8f0886bea555ae748bbf96ceb' 
  AND (
    token = 'Qqea4SAc/883KI8MrXYYOGM4rBq4W0Rk1cXhoTr0jFY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017