UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NlZTxR4u/YFNWHjCVaK8EcRFksWjPLPk1hdtjIbktwY=' 
WHERE 
  key_id = '32755adbc76c4c7d9f4229060ed5a18623e592cf19b9cfb83e9ed2b07ab68575' 
  AND (
    token = 'NlZTxR4u/YFNWHjCVaK8EcRFksWjPLPk1hdtjIbktwY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017