UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5JA1yzp0RW/g7ZI6zHouRUbfCWkgis92voYqpI9Esjo=' 
WHERE 
  key_id = 'd36170072f94e748d67c277a9e8421e32c0e4ec6249d15d9dabef835ddfe56de' 
  AND (
    token = '5JA1yzp0RW/g7ZI6zHouRUbfCWkgis92voYqpI9Esjo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030