UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/50Xjfe2GaiIVcSa7NL9CZewaee8tKarKog2N5y0AjY=' 
WHERE 
  key_id = '48273e95ec7ea7d6bfa89c8304c731b3a3f677a171c9663b826c5696ae4ce5ce' 
  AND (
    token = '/50Xjfe2GaiIVcSa7NL9CZewaee8tKarKog2N5y0AjY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00066