UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bA1uzgHPsMcpIs+LBQ+AI2ypcIbui3LYK+cuAy/pOgQ=' 
WHERE 
  key_id = '82bc8d70dcd9ea9f4f3a5cf491864490dbc9664bbd48d127b28cf79814e0f4bd' 
  AND (
    token = 'bA1uzgHPsMcpIs+LBQ+AI2ypcIbui3LYK+cuAy/pOgQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035