UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ws/U8X56q4bbGG80mXT09N9AVK8i4zTDYoSxZw22g3A=' 
WHERE 
  key_id = '5288908d29fc16ed09c133561436eb5081ab96b6e2dc5fabe33bac73eda7ecd2' 
  AND (
    token = 'ws/U8X56q4bbGG80mXT09N9AVK8i4zTDYoSxZw22g3A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054