UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'igaT8QxmaMWagEpQ4IXR2UsAHKepgbJRkG/e7FEZ/S8=' 
WHERE 
  key_id = '8fc68f97a8676a4c11e81cc285d2ae4a8376f6933bfab9d6b7afe9ad7d654d83' 
  AND (
    token = 'igaT8QxmaMWagEpQ4IXR2UsAHKepgbJRkG/e7FEZ/S8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034