UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QWMErrkuWMqAh14EewRXY7OnauJqj+NiYA4T3/NifwA=' 
WHERE 
  key_id = '7ee96852c7de3ec71de256f36cc9048d410929377dadff79de6188582b44dbb5' 
  AND (
    token = 'QWMErrkuWMqAh14EewRXY7OnauJqj+NiYA4T3/NifwA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037