UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '67q5uMNIsRR6U2tIdFmdsNoHxbB8EdPVc7BBWUBBh7I=' 
WHERE 
  key_id = '84665713defd7b188d9e0a11c2de303e84602180a4d106334cd9c85af147095d' 
  AND (
    token = '67q5uMNIsRR6U2tIdFmdsNoHxbB8EdPVc7BBWUBBh7I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046